package srzy.driver

import srzy.socket.DCCMsgActor
import srzy.diameter._
import srzy.common.Logging

object Start4 extends Logging {

  def deal = {

    val str1 = """<command name="CER">
        <avp name="Origin-Host" value="sm-all-test"></avp>
        <avp name="Origin-Realm" value="chinaunicom.com"></avp>
        <avp name="Host-IP-Address" value="0x000100000000"></avp>
        <avp name="Vendor-Id" value="11"></avp>
        <avp name="Product-Name" value="HP Cx Interface"></avp>
        <avp name="Origin-State-Id" value="62"></avp>
        <avp name="Supported-Vendor-Id" value="10415"></avp>
        <avp name="Auth-Application-Id" value="4"></avp>
        <avp name="Acct-Application-Id" value="0"></avp>
        <avp name="Firmware-Revision" value="1"></avp>
      </command>"""

    val send1 = xml.XML.loadString(str1)
    logger.debug("\n" + send1.toFormatStr)

    val rece = (DCCMsgActor() !! send1).apply.asInstanceOf[scala.xml.Elem]
    println("-------")
    val rece1 = rece.toFormatStr
    logger.debug(rece1)
    //    logger.debug(xml.XML.loadString(rece1).toFormatStr)

  }

  def main(args: Array[String]): Unit = {
    deal
  }

}